package com.isoft.c2team3service2.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("tb_member_order")
public class MemberOrder implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String orderNo; // 唯一订单号

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private Integer userId; // 关联用户ID

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String email; // 用户邮箱

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String memberType; // 会员类型（MONTHLY/QUARTERLY/YEARLY）

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private BigDecimal amount; // 支付金额

    private Integer payStatus; // 支付状态（0-待支付，1-成功，2-失败）

    private LocalDateTime payTime; // 支付时间

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private LocalDateTime expireTime; // 会员过期时间

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}